"""
https://leetcode.cn/problems/two-sum/description/
"""
from typing import List, Dict


def tow_sum(nums: List[int], target: int) -> List[int]:
    """leetcode 1 两数之和

    Args:
        nums (List[int]): 一个整数数组
        target (int): 目标值

    Returns:
        List[int]: 和为目标值的两个整数的下标
    """
    dict_nums: Dict[int, int] = {index: num for index, num in enumerate(nums)}

    for index1, num1 in dict_nums.items():
        for index2, num2 in dict_nums.items():
            if num2 == target - num1 and index2 != index1:
                return [index1, index2]
